package net.nampham.visioncontrol.model;

public class Angle {
	public static final double PI = java.lang.Math.PI;
	public static final double _2PI = java.lang.Math.PI*2;
	double val;
	
	public Angle(double radian){
		//this.val = degree/180.0*PI;
		this.val = radian;
	}
	
	public static Angle FromDegree(double degree){
		return new Angle(degree/180.0*PI);
	}
	
	public Angle add(Angle angle){
		return new Angle((val+angle.val)%_2PI);
	}

	public Angle dec(Angle angle){
		return new Angle((val-angle.val)%_2PI);
	}	
	
	public Angle mul(double times){
		return new Angle((val*times)%_2PI);
	}
}
